﻿using BLL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MODEL;

namespace WebAPI.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class MemberController : ControllerBase
    {
        public MemberController(MemberBLL bLL)
        {
            BLL = bLL;
        }

        public MemberBLL BLL { get; }

        //注册
        [HttpPost]
        public int MemberAdd(MemberMODEL member)
        {
            try
            {
                return BLL.MemberAdd(member);
            }
            catch (Exception)
            {

                throw;
            }
        }

        //登录
        [HttpGet]
        public int MemberLogin(string card, string pwd)
        {
            try
            {
                return BLL.MemberLogin(card, pwd);
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
